package com.chenfan.mcn.dao;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.chenfan.common.extension.mybatisplus.enhanced.EnhancedBaseMapper;
import com.chenfan.mcn.model.BusinessCommissionDetail;
import com.chenfan.mcn.model.dto.BusinessCheckDetailPageDTO;
import com.chenfan.mcn.model.dto.BusinessInfoQueryDTO;
import com.chenfan.mcn.model.vo.BusinessCheckDetailVO;
import com.chenfan.mcn.model.vo.BusinessCommissionDetailVoV2;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * 商务提成明细 Mapper 接口
 * </p>
 *
 * @author lizhejin
 * @since 2021-06-07
 */
public interface BusinessCommissionDetailMapper extends EnhancedBaseMapper<BusinessCommissionDetail> {

    /**
     * 提成单详情-确认详情
     *
     * @param dto
     * @return PageInfo<BusinessCheckDetailVO> {@link BusinessCheckDetailVO}
     */
    List<BusinessCheckDetailVO> getCheckDetailPage(@Param("dto") BusinessCheckDetailPageDTO dto);

    /**
     * 确认详情获取提成人提成金额
     *
     * @param businessId     {@link Long}
     * @param commissionIds  {@link List<Long>}
     * @param businessStatus {@link Integer}
     * @return List<BusinessCommissionDetail>
     */
    List<BusinessCommissionDetail> getPersonalCommissions(@Param("businessId") Long businessId, @Param("commissionIds") List<Long> commissionIds, @Param("status") Integer businessStatus);

    /**
     * 确认详情获取部门负责人提成金额
     *
     * @param businessId          {@link Long}
     * @param departmentHeaderIds {@link List<Long>}
     * @param businessStatus      {@link Integer}
     * @return List<BusinessCommissionDetail>
     */
    List<BusinessCommissionDetail> getDepartmentCommissions(@Param("businessId") Long businessId, @Param("departmentHeaderIds") List<Long> departmentHeaderIds, @Param("status") Integer businessStatus);

    /**
     *
     * @param page
     * @param dto
     * @return
     */
    Page<BusinessCommissionDetailVoV2> selectListV2(Page<BusinessCommissionDetail> page, @Param("dto") BusinessInfoQueryDTO dto);
}
